﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ShareB.Models.RelationsModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ManageFollowers
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>ManageFollowers</h2>

     <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

    <fieldset>
        <legend>My Followers</legend>
        
        <div class="display-label">Me: </div>
        <div class="display-field"><%: Model.UserID %></div>

        <div id ="FollowersList">
            <div class="display-label">Followers: </div>
            <% for (int i = 0; i < Model.Followers.Count; i++ ) {%>
                Follower ID -  <%: Model.Followers[i].Username %>
                <input type="submit" value="Remove" />
            <% } %>
        </div>
    </fieldset>

    <fieldset>
        <legend>My Publishers</legend>
        
        <div class="display-label">Me: </div>
        <div class="display-field"><%: Model.UserID %></div>

        <div id ="PublishersList">
            <div class="display-label">Publishers: </div>
            <% for (int i = 0; i < Model.Publishers.Count; i++)
               {%>
                Publisher ID -  <div class="display-label" id="username"><%: Model.Publishers[i].Username%></div>
                 <%: Html.ActionLink("Remove", "RemovePublishers", new { id = Model.Publishers[i].UserID })%>
            <% } %>
        </div>
    </fieldset>

        

    <% } %>
    <% Html.EndForm(); %>    
    <% Html.BeginForm("SearchPublishers", "User", FormMethod.Get); %>
        <fieldset>
            <legend>Search Publishers</legend>
            <input id="searchValue" name="searchValue" maxlength="100" type="text" />
            <input type="submit" id="submit" value="Search" />
        </fieldset>
    <% Html.EndForm(); %>
    <p>|
        <%: Html.ActionLink("Back to List", "Index") %>
    </p>

</asp:Content>

